#include "PointH.h"


void Point::setPos(int x, int y)
{
	m_x = x;
	m_y = y;
    flag = true;
}

void Point::setSymbol(char c)
{
	m_symb = c;
}


void Point::getPos(int &x, int&y)
{
	x = m_x;
	y= m_y;
}


void Point::draw(char c)
{
	if((m_x >= 0 && m_x <= 79) && (m_y >= 0 && m_y <= 24))
	{gotoxy(m_x,m_y);
	cout << c;}
}


void Point::move()
{
	if(m_x >= MAX_X || m_x <= MIN_X) {
		dir_x = -dir_x;
	}

	if(m_y >= MAX_Y || m_y <= MIN_Y) {
		dir_y = -dir_y;
	}

	m_x += dir_x;
	m_y += dir_y;

}

bool Point::isEqual(Point p){
	return ((p.m_x == m_x) && (p.m_y == m_y));
}